package state_mode

const (
	UnKnown int64 = 0
	Start   int64 = 1
	Doing   int64 = 2
	End     int64 = 3
)

type State interface {
	Start() (int64, error)
	Doing() (int64, error)
	End() (int64, error)
}

//因为go中接口不能成为对象，所以通过结构体在封装一层，实现其方法，完成对象的方法调用
type CaseState struct {
	State State
}

func (c *CaseState) Start() (int64, error) {
	return c.State.Start()
}

func (c *CaseState) Doing() (int64, error) {
	return c.State.Doing()
}

func (c *CaseState) End() (int64, error) {
	return c.State.End()
}
